Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix missing variation selectors #178

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Johnibur
Copy link

Some emojis are missing the variation selector character (\uFE0F) used to specify a glyph to be applied to a preceding character, which makes them systematically fail the parsing test.

This first commit adds the missing character selectors for keycap enclosing digits. But there is likely to have such characters missing for other emojis.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.3%) to 92.625% when pulling d72c736 on Johnibur:fix-missing-variation-selectors into 9a90624 on vdurmont:master.

@yanghanxy
Copy link

I meet with the same problem, and found another emoji ❤️ missing with the variation selector character (\uFE0F)

@yanghanxy
Copy link

directly removing all variation selectors may helps

// remove Variation Selectors for Emoji glyph
StringBuilder sb = new StringBuilder();
for (char ch : sentenceText.toCharArray()) {
    Character.UnicodeBlock ub = Character.UnicodeBlock.of(ch);
    if (ub != Character.UnicodeBlock.VARIATION_SELECTORS && ub != Character.UnicodeBlock.VARIATION_SELECTORS_SUPPLEMENT) {
        sb.append(ch);
    }
}
sentenceText = sb.toString();

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants